import instance from '@/utils/request'

export function login(data) {
  return instance({
    url: '/api/user/login',
    method: 'post',
    data,
  })
}

export function register(data) {
  return instance({
    url: '/api/user/register',
    method: 'post',
    data,
  })
}

export function getUserInfo(token) {
  return request({
    url: '/api/user/info',
    method: 'get',
    params: {
      token
    }
  })
}

export function getCommentList({ page, size }) {
  return instance({
    url: '/api/comment/page',
    method: 'get',
    params: {
      page,
      size
    }
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
